package com.hrt.web.smsRecord.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.hrt.base.BaseDaoImpl;
import com.hrt.bean.SmsRecord;
import com.hrt.web.smsRecord.dao.SmsRecordDao;
@Repository
public class SmsRecordDaoImpl extends BaseDaoImpl<SmsRecord> implements SmsRecordDao{

	@Override
	public SmsRecord getCodeByMobile(String mobile) {
		SmsRecord smsRecord =null;
		String hql = "select sms from SmsRecord sms where sms.mobile='"+mobile+"' and sms.isdelete=0 and isinvalid=0";
		List list = getHibernateTemplate().find(hql);
		if(list!=null&&list.size()>0){
			smsRecord = (SmsRecord) list.get(0);
		}
		return smsRecord;
	}

}
